<?php

include_once('control.functions.php');
include_once("../model/dao.polygon.php");


if ($_REQUEST['func'] == 'list') {
    echo json_encode(objectArray((object) PolygonDAO::getInstance()->listPolygons()));
}

if ($_REQUEST['func'] == 'findById') {
    echo json_encode(objectArray(PolygonDAO::getInstance()->findById($_REQUEST['id'])));
}

?>
